package com.atguigu.exam;

/**
 * @author xbd
 * @create 2021-05-25 22:07
 */
public class ClassName {
    public static void main(String[] args) {
        String str = "D:\\myfile\\hello.java";
        String strCh [] = str.split("\\\\");
        String fileName = strCh[strCh.length-1];
        System.out.println(fileName);

        String strCh1 [] = str.split("[.]");
        String fileName1 = strCh1[strCh1.length-1];
        String file = ".";
        System.out.println(file.concat(fileName1));
    }
}
